A PIC microcontroller chip contains an area of Programmable Read Only Memory (PROM). This is non-volatile in that it holds its contents when the PIC microcontroller is not powered on. When the PIC microcontroller is switched on it executes the program in the PROM.Another part of the PIC microcontroller chip holds Random Access Memory (RAM) which is where the variables in our programs are held. The PIC microcontroller's RAM is more properly called Static RAM (SRAM) in that the values are held statically, with no need for a dynamic refresh circuit.
Some PIC microcontrollers are "One Time Programmable" OTP in that the program they run is stored into the PROM once at manufacture. If you need to change the program, you have to replace the PIC microcontroller. Other PIC microcontrollers are erasable, in that the program in them can be wiped out and replaced with a new one.
There are two ways that this can be done. Some PIC microcontrollers have a window in the top of the package. This allows you to erase the program on the PIC microcontroller by shining ultra-violet light on the chip. This is called Erasable Programmable Read Only Memory (EPROM).
Other PIC microcontrollers are electrically erasable. These are easier to use, in that the contents are wiped by sending signals into the chip. While it can take up to 20 minutes to erase a chip with ultra-violet light the Electrical Erasable Programmable Read Only Memory (EEPROM - or E squared PROM) PIC microcontrollers can be wiped in a few seconds. The PIC microcontroller we are going to use is electrically erasable.
The PIC microcontroller is actually programmed by sending it a programming signal. This is done using a "PIC microcontroller Programmer". The PIC microcontroller development board will function as a PIC microcontroller programmer as well as allowing you to run programs on the PIC microcontroller. Sometimes you program your PIC microcontroller "in circuit" in that the program is loaded into the PIC microcontroller after it is fitted into the product. Other times you program the PIC microcontroller and then insert it into the target device. We will use a program to take the raw PIC microcontroller instructions which come out of the linker and program the PIC microcontroller in the PIC microcontroller development board.
A magnified image of a typical PICmicro
Photo courtesy of Arizona Microchip.